package routers

import (
	"backend/controllers"
	"backend/services"
	"backend/utils"

	"github.com/gin-gonic/gin"
)

func RegisterGroupRoutes(r *gin.RouterGroup) {
	service := services.NewGroupService(utils.DB)
	control := controllers.NewGroupControl(service)
	r.POST("/group/create", control.Create)
	r.PUT("/group/:id/update", control.Update)
	r.DELETE("/group/:id/delete", control.Delete)
	r.GET("/group/list", control.GetList)
	r.POST("/group/binduser", control.BindUser)
	r.POST("/group/bindrole", control.BindRole)
	r.GET("/group/:id/binduser/list", control.ListBindUser)
	r.GET("/group/:id/bindrole/list", control.ListBindRole)
}
